﻿using App.Dal;
using App.Untiys;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace App.Desk.UserControls
{
    public partial class UcInfoButton : UserControl
    {
        public UcInfoButton()
        {
            InitializeComponent();
        }

        public PLCParaModel Parmeter { get; set; }

        public PLCParentParaModel PlusParmeter { get; set; }


        public void SetText(string text)
        {
            labName.Text = text;
        }

        public string GetValue()
        {
            return lblValue.Text;
        }
        public void SetValue(string val)
        {
            //if (PlusParmeter != null)
            //    if (new string[] { "接通报警" , "故障报警", "限位警告" }.Contains(PlusParmeter.GroupName))
            //        if (!string.IsNullOrEmpty(val))
            //            ConfigServices.AddErrors(new Model.ProErrors
            //            {
            //                Errors = val,
            //                GroupName = PlusParmeter.GroupName
            //            });
            lblValue.Text = val;
        }

        private void UcInfo_Load(object sender, EventArgs e)
        {
            this.Height = 28;
            //this.Padding = new Padding(2, 2, 2, 2);
            this.Margin = new Padding(1, 1, 1, 1);
        }
    }
}
